// 用户角色枚举
export enum UserRole {
  ENTERPRISE = 'enterprise',      // 企业端
  SUPERVISOR = 'supervisor',      // 导师端
  STUDENT = 'student',            // 学生端
  ADMIN = 'admin'                 // 高校管理端
}

// 用户信息接口
export interface User {
  id: string
  username: string
  role: UserRole
  name: string
  email: string
  phone?: string
  avatar?: string
  organization?: string
  department?: string
  researchDirection?: string[]
  createdAt: string
  updatedAt: string
}

// 项目状态枚举
export enum ProjectStatus {
  DRAFT = 'draft',                // 草稿
  PUBLISHED = 'published',        // 已发布
  CLOSED = 'closed',              // 已关闭
  MATCHED = 'matched'             // 已匹配
}

// 项目信息接口
export interface Project {
  id: string
  title: string
  enterpriseId: string
  enterpriseName: string
  researchDirection: string[]
  description: string
  requirements: string
  deadline: string
  budget?: number
  status: ProjectStatus
  createdAt: string
  updatedAt: string
}

// 申请状态枚举
export enum ApplicationStatus {
  PENDING = 'pending',            // 待审核
  APPROVED = 'approved',          // 已通过
  REJECTED = 'rejected',          // 已拒绝
  MATCHED = 'matched'             // 已匹配
}

// 申请信息接口
export interface Application {
  id: string
  projectId: string
  projectTitle: string
  applicantId: string
  applicantName: string
  applicantRole: UserRole
  researchPlan?: string
  resume?: string
  status: ApplicationStatus
  createdAt: string
  updatedAt: string
}

// 匹配记录接口
export interface MatchRecord {
  id: string
  projectId: string
  projectTitle: string
  enterpriseId: string
  enterpriseName: string
  applicantId: string
  applicantName: string
  applicantRole: UserRole
  status: 'pending' | 'confirmed' | 'rejected'
  enterpriseConfirm?: boolean
  applicantConfirm?: boolean
  adminConfirm?: boolean
  createdAt: string
  updatedAt: string
}

// 统计数据接口
export interface Statistics {
  totalProjects: number
  totalApplications: number
  totalMatches: number
  projectsByDiscipline: Record<string, number>
  applicationsByStatus: Record<string, number>
  matchesByMonth: Record<string, number>
}

// 分页参数接口
export interface PaginationParams {
  page: number
  pageSize: number
  total?: number
}

// 搜索参数接口
export interface SearchParams {
  keyword?: string
  discipline?: string
  enterpriseName?: string
  status?: string
  dateRange?: [string, string]
}

// API响应接口
export interface ApiResponse<T = any> {
  code: number
  message: string
  data: T
  success: boolean
}

// 分页响应接口
export interface PaginatedResponse<T> extends ApiResponse<T[]> {
  pagination: {
    page: number
    pageSize: number
    total: number
    totalPages: number
  }
}
